# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-fiona
_pkgorig=Fiona
pkgver=1.8.21
pkgrel=1
pkgdesc="Fiona reads and writes geographical data files"
url="https://github.com/Toblerity/Fiona"
arch="all"
license="BSD"
depends="
	cython
	gdal
	gdal-dev
	python3
	python3-dev
	py3-attrs
	py3-click-plugins
	py3-cligj
	py3-certifi
	py3-munch
	py3-six
	py3-tz
	"
checkdepends="py3-pytest py3-pytest-cov py3-boto3"
makedepends="py3-setuptools"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/F/Fiona/Fiona-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"
options="!check" # several tests are failing

build() {
	python3 setup.py build
}

check() {
	mv fiona backup
	# inspired by Arch package
	local python_version=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
	PYTHONPATH="$PWD"/build/lib.linux-$CARCH-$python_version/ pytest -vv --color=yes -m "not wheel"
	mv backup fiona
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir" --skip-build
}

sha512sums="
a28f8ef99942d285a6091505dde9e93f2107a1e41dc6d854b5643dd4f8791dacafde31dc9d2450897d126bf9f136f5c1f3fddde8399d634c745a5844f0afa345  py3-fiona-1.8.21.tar.gz
"
